import VueRouter from 'vue-router'

import HomeContainer from './pages/HomeContainer.vue'
import MemberContainer from './pages/MemberContainer.vue'
import ShopContainer from './pages/ShopContainer.vue'
import SearchContainer from './pages/SearchContainer.vue'


//子组件
import NewsList from './pages/subcomponents/NewsList.vue'
import NewsContent from './pages/subcomponents/NewsContent.vue'
import PhotoList from './pages/subcomponents/PhotoList.vue'
import PhotoInfo from './pages/subcomponents/PhotoInfo.vue'


import GoodsList from './pages/subcomponents/GoodsList.vue'
import GoodsDetail from './pages/subcomponents/GoodsDetail.vue'


const router = new VueRouter({
    routes: [
        { path: '/', redirect: '/home' },
        {
            path: '/home', component: HomeContainer
        },
        { path: '/home/newslist', component: NewsList },
        { path: '/home/news_content/:id', name: 'news_content', component: NewsContent },
        { path: '/home/photo_list', component: PhotoList },
        { path: '/home/photo_info', component: PhotoInfo, name: 'photoinfo' },
        { path: '/home/goods_list', component: GoodsList },
        { path: '/home/goods_detail', component: GoodsDetail, name: 'goodsdetail' },
        { path: '/member', component: MemberContainer },
        { path: '/shop', component: ShopContainer },
        { path: '/search', component: SearchContainer },
    ]
})

export default router